<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=
    , initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body{
            background: black;
            text-align: center;
        }
        #c1{
            background: #fff;
        }
    </style>
    <script>
        window.onload=function(){
            let oC=document.getElementById('c1');
            let gd=oC.getContext('2d');
            gd.moveTo(100,100);
            gd.lineTo(300,300);
            gd.strokeStyle='red';
            gd.stroke();
        }
    </script>
</head>
<body>
    <canvas id="c1" width="800" height="600">
        您的浏览器,不支持canvas
    </canvas>
</body>
</html>